In servo systems for numerically controlling machine tools, a detection of an angle of rotation of a motor, i.e., a detection of an absolute value of a position of an object which is moved by the motor, is carried out by counting incremental outputs of an incremental type pulse encoder.
When counting the incremental outputs of a pulse encoder as mentioned above or when processing informations in the form of a signal, to improve a resolution of the detection of positions or to suppress noise, synchronization by a clock pulse is carried out.
Processing signal information, for example, counting signals, by using a clock pulse is usually carried out, in a numerical control (NC) apparatus by receiving and processing the incremental outputs from a pulse encoder. But, as for counting the incremental outputs of a pulse encoder, or processing signal information to improve a resolution of the detection of positions or to suppress noise, a processing using a clock pulse is sometimes carried out at the pulse encoder side, and for this purpose, the pulse encoders mentioned above are provided with a clock generator.
FIG. 1 shows a general outline of a construction of a pulse encoder having a clock generator, and having a function of carrying out information processing using a clock pulse. In FIG. 1, a motion detecting portion 1, detects a motion of a object whose position should be measured, and outputs a signal (D) having information regarding the motion. A clock generator 3 outputs a clock pulse (CLK). A clock-synchronizing information processing portion, 2 receives the signal having information regarding the motion and the clock pulse, and processes the information regarding the motion by synchronization with the clock pulse.
FIG. 2 shows an actual example of the pulse encoder having the construction shown in FIG. 1, in which a motion detecting portion 1 detects a motion of an object whose position should be measured, and outputs a pair of rectangular pulses P.sub.A, P.sub.B consisting of an A-phase signal and a B-phase signal with a 90.degree. difference therebetween as shown in FIG. 3. The clock-synchronizing information processing portion 2 in FIG. 1 corresponds to an absolute value counting portion 2' in FIG. 2. The absolute value counting portion 2' detects a phase difference between the rectangular pulses P.sub.A, P.sub.B, and counts +1 for a phase difference corresponding to a motion in the positive direction, and counts -1 for a phase difference corresponding to a motion in the negative direction, as shown in FIG. 3. The absolute value counting portion 2' is a synchronous counter type which carries out the counting as mentioned above by synchronization with the clock pulse.
If, however, in the pulse encoder having a construction as mentioned above, i.e., having a clock generator, a malfunction occurs in the clock generator 3, and a clock pulse is not output, the processing in the clock-synchronizing information processing portion 2 can not be carried out because a clock pulse is not input even when the object whose position should be measured moves. For example, in the construction of FIG. 2 as mentioned above, counting is not carried out even when the object moves, and therefore, the NC which receives the output of the absolute value counting portion 2' in the pulse encoder of FIG. 2 determines that the object has not moved because the count of the pulse encoder has not changed. When the information processing regarding the motion can not be carried out even when the object whose position should be measured moves, because the clock pulse is not output due to a malfunction in the clock generator 3, it is necessary to inform the NC of the malfunction immediately.